package hzn.controller;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import hzn.entity.Dept;
import hzn.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
public class Consumer_Feign {
    @Autowired
    DeptClientService service;


    @RequestMapping("/consumerFeign/dept/get/{id}")
    public Dept get(@PathVariable Integer id){
        return service.get(id);
    }

    @RequestMapping("/consumerFeign/dept/list")
    public List<Dept> list(){
        return service.list();
    }


}
